// TemplateClassToNormalClass.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

template <class PARATYPE>
class BaseTemplateClass
{
protected:
	PARATYPE m_basevalue;
public:
	PARATYPE getValue(){return m_basevalue;};
	void setValue(PARATYPE val){m_basevalue = val;};
	void addValue(PARATYPE addvalue);
};

template <class PARATYPE>
void BaseTemplateClass<PARATYPE>::addValue(PARATYPE addvalue)
{	
	m_basevalue += addvalue;
}

class DrivedClass:public BaseTemplateClass<int>
{
private:
	int m_DrivedValue;
public:
	void SetDrivedValue(int val){m_DrivedValue = val;};
	int getDrivedValue(){return m_DrivedValue;};
	void AddDrivedValue(int addvalue);
};

void DrivedClass::AddDrivedValue(int addvalue)
{
	m_DrivedValue += addvalue;
}


int main(int argc, char* argv[])
{
	BaseTemplateClass<int> a;
	BaseTemplateClass<float> b;

	DrivedClass c;

	DrivedClass d;

	printf("Hello World!\n");
	return 0;
}

